VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "ThisWorkbook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Option Explicit
' When Option Explicit appears in a module, you must explicitly declare all variables
' using the Dim, Private, Public, ReDim, or Static statements.
' If you attempt to use an undeclared variable name, an error occurs at compile time.
' ==> Recommended to be used

' Declaration Constantes
Const vbext_ct_ClassModule As Integer = 2
Const vbext_ct_Document = 100
Const vbext_ct_MSForm = 3
Const vbext_ct_StdModule  As Integer = 1
     
' Exports all VBA project components containing code to a folder.
' And
' Saves Excel File : Escalation Follow-UP.xls PERSONAL.xls

Public Sub ExportAllComponents()
   Dim VBComp As VBIDE.VBComponent
   Dim fName As String, ext As String
    
    ' Saves Excel File : Escalation Follow-UP.xls PERSONAL.xls : Autoit Executable
    'Shell Def_Shell_For_SaveExcelFiles
    
    Application.Workbooks("PERSONAL.XLSB").Activate
      
    For Each VBComp In ActiveWorkbook.VBProject.VBComponents
        If VBComp.CodeModule.CountOfLines > 0 Then
            'Determine the standard extention of the exported file.
            'These can be anything, but for re-importing, should be the following:
            Select Case VBComp.Type
                Case vbext_ct_ClassModule: ext = ".cls"
                Case vbext_ct_Document: ext = ".cls"
                Case vbext_ct_StdModule: ext = ".bas"
                Case vbext_ct_MSForm: ext = ".frm"
                Case Else: ext = vbNullString
            End Select
            If ext <> vbNullString Then
                fName = Def_Col_SVNCode_Directory & "\" & VBComp.Name & ext
                'Overwrite the existing file
                'Alternatively, you can prompt the user before killing the file.
                If Dir(fName, vbNormal) <> vbNullString Then Kill (fName)
                VBComp.Export (fName)
            End If
        End If
    Next VBComp

End Sub


